package fi.internetix.ck;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class ANodePrinter extends HTMLNodePrinter {

  public void processNode(Node node, StringBuilder output) {
    Node attribute = node.getAttributes().getNamedItem("name");
    if (attribute != null && attribute.getNodeValue().equals("DDE_LINK")) {
      NodeList children = node.getChildNodes();
      for (int i = 0; i < children.getLength(); i++) {
        Node child = children.item(i);
        NodePrinter nodePrinter = NodePrinterUtils.getNodePrinter(child);
        if (nodePrinter != null) {
          nodePrinter.processNode(child, output);
        }
      }
    }
    else {
      super.processNode(node, output);
    }
  }

}
